﻿
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using System.Drawing;
using System.Drawing.Imaging;
using TemplateDemo.Model.user;
using TemplateDemo.Service;

namespace TemplateDemo.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class AccountController : ControllerBase
    {
        private readonly IAccountService accountService;
        private readonly IMemoryCache _memoryCache;

        public AccountController(IAccountService accountService,IMemoryCache memoryCache)
        {
            this.accountService = accountService;
            this._memoryCache = memoryCache;
        }
        /// <summary>
        /// 获取token
        /// </summary>
        /// <param name="login"></param>
        /// <returns></returns>
        [HttpPost("Token")]
        public  async Task<IActionResult> Token(LoginModel login)
        {
           var res=await accountService.Login(login);
            return Ok(res);
        }
    }
}
